!T!1473w
GRAPHICS TOKEN MANIPULATION - pixel by pixel
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  char  *get_token  (width, height, row, column)
  char  *read_token (file)
  int   put_token   (token_ptr, row, column)
  int   write_token (token_ptr, file)

  char *file      // graphics token file name
  char *token_ptr // pointer to upper left corner of memory token
  int  row        // left screen row: 0-479
  int  column     // top screen column:  0-639

  Note: read_token() & get_token() return token_ptr.
GRAPHICS IMAGE MANIPULATION - plane by plane
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  char  *get_image  (width, height, row, column)
  char  *read_image (file)
  int   put_image   (image_ptr, row, column)
  int   write_image (image_ptr, file)

  char *file
  char *image_ptr  // pointer to upper left corner of memory image
  int  row         // left screen row: 0-479
  int  column      // top screen column:  0-639

  Note: get_image() returns image_ptr.

GRAPHICS IMAGE DISK SAVE/RESTORE - plane by plane
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int save_image    (file, width, height, row, column)
  int restore_image (file, row, column)

      char *file   // graphics image file name
      int width    // screen image width:  1-640
      int height   // screen image height: 1-480
      int row      // top screen row:      0-479
      int column   // left screen column:  0-679



GRAPHICS FULL SCREEN DISK SAVE/RESTORE - plane by plane
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int save_overlay    (file, ext)
  int restore_overlay (file, ext)

      char *file   // overlay file name
      char *ext    // file extension (".ovl" or ".fvl")






GET & PUT PIXEL
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int get_pixel (row, column)
  int put_pixel (value, row, column)

      int row      // screen row:    0-479
      int column   // screen column: 0-639
      int value    // BKGND_BLACK thru FGND_WHITE (0-15)





TEXT FILE PROCESSING - linefeed terminated lines
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int read_text   (file, memory, width, max_lines)
  int write_text  (file, memory, width, max_lines)
  int append_text (file, memory, width, max_lines)

      char *file     // text file name
      char *memory   // file contents read into memory; lines expanded
      int  width     // line width (lines expanded with spaces)
      int  max_lines // maximum number of lines



TEXT RECORD PROCESSING - block structured file, no linefeeds
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int read_record  (file_ptr, number, memory, record_size)
  int write_record (file_ptr, number, memory, record_size)

      FILE *file_ptr  // FILE pointer from prior xopen() command
      long number     // data record (block) to be read/written
      char *memory    // record (block) in memory

  Note: File previously opened by xopen().



CALL & OVERLAY PROGRAM
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int call_program    (file, arg_ptr)
  int overlay_program (file, arg_ptr)

      char *file     // program file name
      char *arg_ptr  // pointer to string argument






START & STOP PROGRAM
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int start_program ()
  int stop_program  (status)

      int status // program exit status returned to call_program()







PALETTE CONTROL
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int read_palette  (memory, file)
  int write_palette (memory, file)
  int get_palette   (memory)
  int put_palette   (memory)
  int load_palette  ()

      char *memory  // palette contents in memory
      char *file    // palette file name



HORIZONTAL MENU PROCESSING
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  char *select_across (line, column)

       int line     // menu screen line
       int column   // column (left) of active horizontal command list

  Note: Menu selection begins at intiaal highlighted command at
        BEGIN_SELECT

  Return: 1. Pointer to selected command
          2. LAST_CHAR = first character of selected command

CONVENTIONAL (TWO COLUMN) MENU PROCESSING
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  char* process_menu(TOP, BOTTOM, LEFT, RIGHT, ITEM, COLUMN);

        int TOP      // top line of two column menu
        int BOTTOM   // bottom line
        int LEFT     // left (column) column
        int RIGHT    // right (column) column
        int ITEM     // starting menu entry (0-n)
        int COLUMN   // left (0) or right (1) column



PULL-DOWN MENU PROCESSING
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int select_down (keep_no,memory,size,width,height,line,col,back,fwd)

      int  keep_no     // save area (1-9) for screen contents
      char *memory     // pull-down menu in memory
      int  size        // size of pull-down menu in memory
      int  width       // pull-down window width
      int  height      // pull-down window height
      int  line, col   // upper left corner of screen menu
      int  back, fwd   // used in conjunction with select across()

  - see next frame -

  select_down() returns:

     1. LAST_PTR    pointer to selected command line
     2. LAST_CHAR   (first letter of command) pressed
     3. LAST_ITEM   selected command number: 1-9








DATA ENTRY FORM PROCESSING
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int vfm          (file)
  int read_form    (file)
  int erase_form   ()
  int display_form ()

        char *file    // form (*.frm) name





DATA ENTRY FORM COLLECTIVE FIELD PROCESSING
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int  erase_fields   (FPTR)
  int  define_fields  (FPTR)
  int  display_fields (FPTR)
  int  enter_form     (FPTR)
  int  resume_form    (base_ptr, FPTR)
  char *new_form      ()

       form_entry *FPTR     // pointer to DATA ENTRY TABLE
       form_entry *baseptr  // starting entry in form

       Globals: LAST_FIELD, FUNC, ARROW, ESCAPE_KEY
DATA ENTRY FORM INDIVIDUAL FIELD PROCESSING
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int  set_field         (field_name, FPTR)
  int  next_field        ()
  char *form_field       (field_name, FPTR)
  FPTR locate_field      (field_name, FPTR)
  int  display_one_field (FPTR)
  int  enter_field       (FPTR)

        char       *field_name  // field name in DATA ENTRY TABLE
        form_entry *FPTR        // pointer to DATA ENTRY TABLE or entry


DATA ENTRY FORM ENTER & SHIFT FIELD
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int enter_shift (field_name, memory, extent)

      char         *field_name
      char         *memory
      unsigned int extent






DATA ENTRY FORM FLAT FILE RECORD INTERFACE
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int load_data    (file, FPTR)
  int store_data   (file, FPTR)

  int load_fields  (memory, FPTR)
  int store_fields (memory, FPTR)

      char       *file    // datafile
      char       *memory  // record containing concatenated fields
      form_entry *FPTR    // pointer to DATA ENTRY TABLE


TEXT WINDOW PROCESSING
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int make_window_frame   (width, height, line, column)
  int enter_window        (memory, width, height, line, column)
  int see_window          (memory, width, height, line, column)
  int clear_window        (width, height, line, column)
  int remove_window       (width, height, line, column)

      int width, height   // screen window dimensions
      int line, column    // top left corner of window
      char *memory        // pointer to window in memory


TEXT WINDOW MEMORY BROWSING
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int browse            (memory, size, width, height, line, column)
  int browse_select     ( same )
  int browse_view       ( same )
  int browse_check      ( same )
  int browse_check_edit ( same )

      char *memory        // pointer to browse area in memory
      int  size           // size of browse area
      int  width, height  // screen window dimensions
      int  line, column   // upper left corner of screen window

TEXT WINDOW KEEP & RESTORE
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int keep_window    (keep_no, width, height, line, columm)
  int restore_window (keep_no, width, height, line, column)

      int  width, height  // screen window dimensions
      int  line, column   // upper left corner of window
      char *win_ptr       // pointer to saved window contents in memory





TEXT FULL SCREEN SAVE & RESTORE
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int save_text_screen    (file)
  int restore_text_screen (file)

      char *file      // file name







TEXT CURSOR CONTROL
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int getcursor      (&line, &column)
  int cursor         (line, column)
  int keep_cursor    ()
  int restore_cursor ()
  int hide_cursor    ()
  int show_cursor    ()

      int line, column



SCREEN FIELD DISPLAY
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int see     (string)
  int see_    (field, size)
  int see_dup (string, size)

      char *string  // string (null terminated) to display
      char *field   // field (not null terminated) to display
      int  size     // size of field or see_dup() repeat count




SCREEN DISPLAY CONTROL
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int draw           (special_character)
  int clear_screen   (bkgnd_color, fgnd_color)
  int clear_line     (line)
  int clr_end        ()
  int clear_tabs     ()
  int set_tab_column (tabno, column)
  int beep           ()

      int line, column, tabno
      int bkgnd_color, fgnd_color  //  See BKGND & FGND values

KEYBOARD FIELD ENTRY
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int enter               (field, size, line, column)
  int enter_numeric       (field, size, line, column)
  int enter_numeric_right (field, size, line, column)
  int enter_digits        (field, size, line, column)
  int enter_noecho        (field, size, line, column)
  int enter_phone         (field, line, column)
  int enter_socsec        (field, line, column)
  int enter_date          (field, line, column)
      char *field         // pointer to field
      int  size           // field size
      int  line, column   // starting screen position
WAIT FOR KEYBOARD INPUT
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int wait_key     (NULL, line, column)
  int wait_FUNC    (line, column)
  int key_waiting  ()
  int wait_display ()

      int line, column  // screen position





GRAPHICS MOUSE CONTROL
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int mouse_installed      ()
  int mouse_button_pressed (button)
  int mouse_button_down    (button)
  int mouse_movement       ()
  int get_mouse_position   ()
  int mouse_cursor         (row, column)
  int show_mouse_cursor    ()
  int hide_mouse_cursor    ()
      int button:   // 1 or 2
      int row       // screen row: 0-479
      int column    // screen column: 0-639
FIELD MOVE
▀▀▀▀▀▀▀▀▀▀

  int move       (field1, field2, size)
  int move_right (field1, field2, size)
  int move_all   (field1, field2, size)

      char *field1  // source field, or pointer to character
      char *field2  // destination field
      int  size     // size of field




FIELD CONVERT
▀▀▀▀▀▀▀▀▀▀▀▀▀

  int fill          (character, field, size)
  int erase         (field, size)
  int to_upper_case (field, size)
  int shift_right   (field, size)
  int shift_left    (field, size)
  int insert_commas (field, size)
  int remove_commas (field, size)
      char character     // fill character, or character to be replaced
      char new_character // character replacement
      char *field        // destination field
      int  size          // field size
NUMERIC FIELD EDIT
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int right_justify   (field, size)
  int justify         (field, size, decpos)
  int zero_fill       (field, size)
  int zero_suppress   (field, size)
  int protect_float   (field, size, float_character)
  int move_numeric    (field1, field2, size)
  int load_mask_right (field, size)
  int move_edit_right (field1 ,field2, size)
      char *field, *field2  // destination field
      char *field1          // source field
      int  size             // field size
NUMERIC FIELD INFO
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int decimal_point (field, size)
  int is_negative   (field, size)

      char *field   // destination field
      int size      // field size






MAKE STRING
▀▀▀▀▀▀▀▀▀▀▀

  char *make_string         (field, size)
  char *make_string_reverse (field, size)

       char *field    // destination field
       int size       // field size






FIELD COMPARE
▀▀▀▀▀▀▀▀▀▀▀▀▀

  int compare        (field1, field2, size)
  int compare_all    (field1, field2, size)
  int compare_string (string1, string2)

      char *field, *field1  // source field
      char *field2          // destination field
      int  size             // field size




MESSAGE DISPLAY
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int display_message (string1, string2)
  int display_error   (string1, string2)
  int wait_display    ()

      char *string, *string1  // first part of message
      char *string2           // last part of message
      int  line               // screen line number




TIME AND DATE
▀▀▀▀▀▀▀▀▀▀▀▀▀

  int enable_time  (type, line, column)
  int disable_time ()
  int see_date     (line, column)
  int get_month    ()
  int get_year     ()
  char *get_time   ()  "Thu May 12 09:14:06 1994"

       int type     // 'C' or 'M'
       int line     // screen line number
       int column   // screen column number

SCREEN COLOR CONTROL
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int set_color             (color)
  int keep_colors           ()
  int restore_colors        ()
  int keep_window_colors    ()
  int restore_window_colors ()
  int keep_form_colors      ()
  int restore_form_color    ()
  int set_intense           (ON/OFF)
  int set_blink             (ON/OFF)

      int color    // BKGND_BLK to FGND_YELLOW (0-16)
KEEP & RESTORE ALL SCREEN ATTRIBUTES
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int keep_all    (keepall_no)
  int restore_all (keepall_no)

      int keepall_no  // 0-9







FIELD LENGTH (to SPACE)
▀▀▀▀▀▀▀▀▀▀▀▀

  int          token_length (memory)
  unsigned int text_length  (memory_start, memory_end)

           char *memory, *memory_start  // start of token in memory
           char *memory_end             // end of scanned area






FILE CONTROL
▀▀▀▀▀▀▀▀▀▀▀▀

  FILE* xopen      (file, mode)

        char *file   file name
        char *ext    file extension
        char *mode   "r", "w", etc.






GRAPHICS MODE CONTROL
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

   int set_graphics_mode(mode)

       int mode  ON/OFF








ARITHMETIC FIELD PROCESSING
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  int complement       (field, size)
  int add_literal      (literal, field)
  int add              (field1, field2, size)
  int add_one          (field)
  int subtract_literal (literal, field)
  int subtract_one     (field)
  int subtract         (field1, field2, size)

      char *field, *field1  // source field
      char *field2          // destination field
      int  size             // field size
